<?php

namespace Application\controller;

use Application\model\QuestionnaireModel;
use Cola\Controller;
class VipServiceController extends Controller
{
    public function getService() {
        $data = [
            'content' => '',
            'qrcodeUrl' => '',
            'wechat' => '',
            'items' => '',
            'status' => '0',
        ];
        $cpid = $this->get('gameId');
        $cpid = empty($cpid) ? realGAME_ID() : $cpid;

        $NoticeModel = $this->model('Notice');
        //$srids = $NoticeModel->getSrids($cpid);
        //var_dump($srids);die();
        $service = $this->model('VipService')->getLoginNoticeByCid(realCID());
        //兼容
        /*if (empty($service)){
            $service = $this->model('VipService')->getinfo($cpid);
        }*/
        if (empty($service)) $this->success($data);
        $data['content'] = htmlToBBCode($service['content']);
        $data['qrcodeUrl'] = $service['qrcode'];
        $contact = '';
        if (!empty($service['contact']) && !empty($service['wechat'])) {
            $contact = $service['contact'].'|'.$service['wechat'];
        }
        $data['wechat'] = $contact;
        $data['items'] = $service['items'];
        $data['status'] = $service['status'];
        $this->success($data);
    }

}